import request from '@/utils/request'

export function listPurchase(query) {
  return request({
    url: '/purchase/list',
    method: 'get',
    params: query
  })
}

export function queryHerb(data){
  return request({
    url: '/purchase/queryHerb',
    method: 'post',
    data
  })
}

export function queryAddress(){
  return request({
    url: '/purchase/queryAddress',
    method: 'post',
  })
}

export function queryPurchaseItem(query){
  return request({
    url: '/purchase/queryPurchaseItem',
    method: 'post',
    params: query
  })
}


export function createPurchase(data) {
  return request({
    url: '/purchase/create',
    method: 'post',
    data
  })
}

export function readPurchase(data) {
  return request({
    url: '/purchase/read',
    method: 'get',
    data
  })
}

export function updatePurchase(data) {
  return request({
    url: '/purchase/update',
    method: 'post',
    data
  })
}

export function deletePurchase(data) {
  return request({
    url: '/purchase/delete',
    method: 'post',
    data
  })
}
